home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / vgatx10s.zip / TYPEDEF.H < prev    next >
C/C++ Source or Header  |  1997-04-12  |  3KB  |  86 lines

  1. /*
  2.  * This file is part of the VgaText C++ Programming Library
  3.  *
  4.  * Copyright (c) 1995, 1997 by Branislav L. Slantchev
  5.  * A fine product of Silicon Creations, Inc. (gargoyle)
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the License which accompanies this
  9.  * software. This library is distributed in the hope that it will
  10.  * be useful, but without any warranty; without even the implied
  11.  * warranty of merchantability or fitness for a particular purpose.
  12.  *
  13.  * You should have received a copy of the License along with this
  14.  * library, in the file LICENSE.DOC; if not, write to the address
  15.  * below to receive a copy via electronic mail.
  16.  *
  17.  * You can reach Branislav L. Slantchev (Silicon Creations, Inc.)
  18.  * at bslantch@cs.angelo.edu. The file SUPPORT.DOC has the current
  19.  * telephone numbers and the postal address for contacts.
  20. */
  21. #ifndef INCLUDED_TYPEDEF_H
  22. #define INCLUDED_TYPEDEF_H
  23.  
  24. #ifndef PB_SDK
  25.     #include <stddef.h>
  26. #else
  27.     typedef unsigned int size_t;
  28. #endif
  29.  
  30. typedef unsigned char  uchar;
  31. typedef unsigned char  byte;
  32. typedef unsigned char  BOOL;
  33.  
  34. typedef unsigned short ushort;
  35. //typedef unsigned short word;
  36.  
  37. typedef unsigned int   uint;
  38.  
  39. typedef unsigned long  ulong;
  40. typedef unsigned long  dword;
  41.  
  42. #ifndef _TV_VERSION
  43.     typedef enum { False, True } Boolean;
  44. #endif
  45.  
  46. // function types
  47. typedef Boolean (*fpTestFunc)(const void *item, void *arg);
  48. typedef void    (*fpAppFunc) (void *item, void *arg);
  49. typedef int     (*fpCompFunc)(const void *item1, const void *item2);
  50.  
  51. typedef unsigned char  DateType[3];         //........day[0], mon[1], year[2]
  52. //.............................day (1..31), month (1..12), year (year - 1900)
  53. typedef unsigned char  TimeType[3];         //........hour[0], min[1], sec[2]
  54. //...............................hour (0..59), minute (0..59), second (0..59)
  55. typedef unsigned char  TimeFrame[7][6];     //...........7-days, 48-slots/day
  56. typedef unsigned char  combinedboards[125]; //..........1,000 areas, bit/area
  57. typedef unsigned short KEY;                 //......for ScanKey return values
  58. typedef unsigned long  accessflags;         //......flags mapped onto 32 bits
  59. typedef unsigned char  DateRaType[9];       //....pascal string with MM-DD-YY
  60. typedef unsigned char  TimeRaType[6];       //.......pascal string with HH:MM
  61.  
  62. typedef struct{          //....................standard MS-DOS packed date stamp
  63.     ushort day : 5;   //.............................day of the month (1..31)
  64.     ushort mon : 4;      //................month of the year (Jan = 1, Dec = 12)
  65.     ushort year: 7;      //..................................current year - 1980
  66. } datestamp_t;
  67.  
  68. typedef struct{          //....................standard MS-DOS packed time stamp
  69.     ushort sec : 5;      //..............................current seconds (0..59)
  70.     ushort min : 6;      //..............................current minutes (0..59)
  71.     ushort hour: 5;      //.................................current hour (0..23)
  72. } timestamp_t;
  73.  
  74. typedef struct{                   //...............packed date/time structure
  75.     union{
  76.         datestamp_t st_date;      //................date stamp, MS-DOS format
  77.         ushort      st_ssdate;      //........same, used for reading as integer
  78.     };
  79.     union{
  80.         timestamp_t st_time;      //................time stamp, MS-DOS format
  81.         ushort      st_sstime;      //........same, used for reading as integer
  82.     };
  83. } stamp_t;
  84.  
  85. #endif /* INCLUDED_TYPEDEF_H */
  86.